package com.android.infantschool.util;

import android.util.DisplayMetrics;

import com.android.infantschool.app.InfantApp;

/**
 * Author:       Administrator
 * Date:         2019/8/8  9:37
 * Description:  ScreenUtil
 */
public class ScreenUtil {

    /**
     * 获取屏幕高度
     *
     * @return
     */
    public static int getHight() {
        return getDisplay().heightPixels;
    }

    /**
     * 获取屏幕宽度
     *
     * @return
     */
    public static int getWidth() {
        return getDisplay().widthPixels;
    }

    private static DisplayMetrics getDisplay() {
        return InfantApp.context.getResources().getDisplayMetrics();
    }

}